home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tchk20.arc / DEMO.ARC / DEMOPARS.C < prev    next >
Text File  |  1989-01-13  |  982b  |  41 lines

  1. /* demopars.c  -  used for testing TCHK parsing functions */
  2.  
  3. #include <howard.h>
  4. #include <video.h>
  5. #include <color.h>
  6. #include <filehk.h>
  7. #include <keycode.h>
  8. #include <keyboard.h>
  9. #include <string.h>
  10. #include <alloc.h>
  11.  
  12. void main();
  13.  
  14. void main()
  15. {
  16.     struct filespec *fs;
  17.     char temp[80], temp2[80];
  18.     int k, argk[] = { ESC };
  19.  
  20.     do {
  21.         cls();
  22.         textattr(LCYAN);
  23.         cputs("Input a filespec:");
  24.         textattr(LRED);
  25.         strfill(temp,' ',59);
  26.         k = getget(19,1,temp,60,"X",1,argk,TRIMALL);
  27.         if (k == ESC)
  28.             break;
  29.         fs = parsefilename(temp);
  30.         gotoxy(1,2);
  31.         textattr(YELLOW);
  32.         cprintf("Parsed -> %c    %s    %s\r\n",fs->drive,fs->path,fs->filename);
  33.         expandfilespec(temp,temp2);
  34.         cprintf("Expanded -> %s\r\n",temp2);
  35.         textattr(LRED);
  36.         cputs("Press any key to continue");
  37.         inkey(TRUE);
  38.         free(fs);
  39.     } while (TRUE);
  40. }
  41.